import { createBrowserRouter } from 'react-router-dom';

import App from '@/App';
import Creation from '@/views/Creation';
import Home from '@/views/Home';
import Vip from '@/views/Vip';
import Works from '@/views/Works';

export const homeList = [
  { path: '/', element: <Home />, text: '首页', icon: 'home' },
  { path: '/works', element: <Works />, text: '作品', icon: 'works' },
  { path: '/creation', element: <Creation />, text: '创作区', icon: 'creation' },
  { path: '/vip', element: <Vip />, text: '会员', icon: 'vip' },
  { path: '/user', element: <Home />, text: '我的', icon: 'user' },
];

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,

    children: [...homeList.map((t) => ({ path: t.path, element: t.element }))],
  },
]);

export default router;
